(define (sieve)
  (define (ints i)
    (cons i
          (lambda ()
            (ints (+ i 1)))))
  
  (define (except-remainder x stream)
    (define a (car stream))
    (define d ((cdr stream)))
    (if (= (remainder a x) 0)
        (except-remainder x d)
        (cons a
              (lambda ()
                (except-remainder x d)))))
  
  (define (iter numbers)
    (cons (car numbers)
          (lambda ()
            (iter (except-remainder (car numbers)
                                    ((cdr numbers)))))))
  
  (iter (ints 2)))
